package com.niiwoo.civet.trade.dao.mapper;

import com.niiwoo.civet.trade.dao.entity.KaolaRepayOrder;
import com.niiwoo.civet.trade.dao.entity.ProjectBorrowerSummary;
import org.apache.ibatis.annotations.Param;

public interface KaolaRepayOrderMapperExt extends KaolaRepayOrderMapper{

    /**
     * 根据项目id查询正在处理中的还款请求数
     *
     * @param projectId 项目ID
     * @return 正在进行中的标的数
     */
    int countProcessingRepay(@Param("projectId")Long projectId);

    /**
     * 查询标的当前期是否已代扣成功
     *
     * @param summary 标的概要
     * @return
     */
    int selectWithholdSucc(ProjectBorrowerSummary summary);

    /**
     * 查询某个标的的某一期最后一次还款状态
     *
     * @return
     */
    KaolaRepayOrder selectLastRepayOrderByProjectIdAndRepayNo(@Param("projectId") Long projectId, @Param("currentPeriod") Integer currentPeriod);

}